const path=require('path');
const Koa=require('koa');
const static=require('koa-static');
const app=new Koa();

app.use(async (ctx,next)=>{
    console.log('\n\nurl:',ctx.url);
    await next();
});

app.use(static(path.join(__dirname,'static')));

app.use(ctx=>{
    ctx.body='Hello Koa!!';
});

app.listen(4000,()=>{
    console.log('StaticServer port:4000----'+new Date().toLocaleTimeString());
});